import { stringify } from 'qs';
import request from '@/utils/request';


/**
 * 会员卡列表
 * @param {*} params 
 */
export async function queryVipCard(params) {
  return request('/memberCardController/list', {
    method: 'POST',
    data: {
      ...params
    },
  });
}



/**
 * 删除会员卡
 * @param {*} params 
 */
export async function removeVipCard(params) {
  return request(`/memberCardController/delete?${stringify(params)}`);
}

/**
 * 批量删除会员卡
 * @param {*} params 
 */
export async function batchRemoveVipCard(params) {
  return request(`/member/batchDeleteMember?${stringify(params, { arrayFormat: 'brackets' })}`);
}


/**
 * 新增会员卡
 * @param {*} params 
 */
export async function addVipCard(params) {
  return request('/memberCardController/save', {
    method: 'POST',
    data: { ...params },
  });
}

/**
 * 更新会员卡
 * @param {*} params 
 */
export async function updateVipCard(params) {
  return request('/memberCardController/update', {
    method: 'POST',
    data: { ...params },
  });
}

/**
 * 根据用户信息查询场馆List
 * @param {*} params 
 */
export async function fetchShopList(params) {
  return request('/venueInfo/queryVenueInfoListByUserId', {
    method: 'POST',
    requestType:'form',
    data: { ...params },
  });
}

/**
 * 查询会员卡详情
 * @param {*} params 
 */
export async function fetchVipCard(params) {
  return request('/memberCardController/queryMemberCardInfoByCardId', {
    method: 'POST',
    requestType:'form',
    data: { ...params },
  });
}

/**
 * 查询会员的会员卡详情
 * @param {*} params 
 */
export async function getMemberCardInfo(params) {
  return request('/memberCardController/getMemberCardInfo', {
    method: 'POST',
    data: {
      ...params
    },
  });
}

/**
 * 消费记录
 * @param {*} params 
 */
export async function getConsumeRecord(params) {
  return request('/member/getConsumeRecord', {
    method: 'POST',
    data: {
      ...params
    },
  });
}



